package com.originskyseed.platform.common.api.constant;

import java.io.Serializable;

import com.originskyseed.platform.core.tenant.util.TenantCodeUtil;

/**
 * @description Redis的key常量
 * @author: HanGuJi
 * @create: 2019-09-04 22:03
 **/
public class RedisKeyConstans implements Serializable {

	private static final long serialVersionUID = 2700685973475045427L;

	/**
	 * Redis 行政区域Key
	 */
	public static final String REDIS_PROVINCE = "administrativePrefix_province";

	/**
	 * Redis 商品分类
	 */
	public static final String REDIS_CATEGORY = "goodsCategoryPrefixkey_category";

	/**
	 * Redis 商品分类修改标识 格式key-mallId
	 */
	public static final String REDIS_CATEGORY_MAX_TIME = "redis_category_max_time";

	/**
	 * Redis 轮播图
	 */
	public static final String REDIS_CAROUSEL = "carouselPrefixkey_images";

	/**
	 * 首页专题
	 */
	public static final String REDIS_MALL_RECOMMEND = "mallRecommendPrefixkey_recommend";

	/**
	 * 商户导入密码前缀 KEY+y用户ID
	 */
	public static final String MERCHANT_IMPORT_PASSWORD = "IMPORT_MERCANT_PASSWORD";

	/**
	 * 会员导入密码前缀 KEY+y用户ID
	 */
	public static final String MEMBER_IMPORT_PASSWORD = "MEMBER_IMPORT_PASSWORD";

	/**
	 * 会员导入密码前缀 KEY+y用户ID
	 */
	public static final String SUPPLIER_IMPORT_PASSWORD = "SUPPLIER_IMPORT_PASSWORD";

	/**
	 * 首页统计数据Redis的KEY
	 */
	public static final String HOME_STATISTICS_INFO = "home_statistics_info";

	/**
	 * 热销推荐分类
	 */
	public static final String MALL_GOODS_HOT_CATEGORY = "mall_goods_hot_category";

	/**
	 * 推荐分类
	 */
	public static final String GOODS_RECOMMEND_CATEGORY = "goods_recommend_category";

	/**
	 * 付款积分防重放控制
	 */
	public static final String ORDER_PAY_INTEGRA = "ORDER_PAY_INTEGRA_";

	/**
	 * 订单商品统计报表，默认查询的时间间隔 90天
	 */
	public static final Integer STATISTICAL_DAYS = 90;

	/**
	 * 订单商品统计报表，默认查询的时间间隔 90天
	 */
	public static final String ORDER_INVOICE_BY_ORDER_NUM = "ORDER_INVOICE_BY_ORDER_NUM_";

	/**
	 * 订单商品统计报表，默认查询的时间间隔 90天
	 */
	public static final String BILL_AUDIT_BY_ORDER_ID = "BILL_AUDIT_BY_ORDER_ID_";

	/**
	 * 虎拉购中台首页统计Redis缓存Key
	 */
	public static final String STATISTICAL_ETONE_HOME = "statisticalEtoneHomeKey";

	/**
	 * 首页统计Redis缓存key
	 */
	public static final String INDEX_PAGE_STATISTICAL = "indexPageStatisticalKey";

	/**
	 * 发票ID缓存
	 */
	public static final String INVOICE_ID_CACHE = "invoiceIdCache";

	/**
	 * 角色对应的菜单缓存key
	 */
	public static final String ROLE_MENU_KEY = "roleMenuKey";

	/**
	 * 导出任务状态缓存
	 */
	public static final String EXPORT_EXCEL_STATUS = "export_excel_status";

	/**
	 * 下单重复提交控制(Service控制)
	 */
	public static final String ORDER_REPEAT_CONTROLLER = "order_repeat_controller";

	/**
	 * 缓存检测订单定时器报错
	 */
	public static final String CHECK_ORDER_AUTO_UPDATE_STATUS_ERROR = "CHECK_ORDER_AUTO_UPDATE_STATUS_ERROR";

	/**
	 * Redis 平台审核
	 */
	public static final String REDIS_PLATFORM = "redis_platform";

	/**
	 * 列表字段头配置数据
	 */
	public static final String FIELD_LIST_KEY = "field_list_key";

	/**
	 * 发送对账单重复key
	 */
	public static final String BILL_AUDIT_REPETITION_KEY = "bill_Audit_repetition_key";

	/**
	 * Redis 商品分类一级 key-mallId
	 */
	public static final String REDIS_FIRST_CATEGORY = "redis_first_category";

	/**
	 * 购物车列表缓存
	 */
	public static final String REDIS_GOODS_CART_LIST_KEY = "redis_goods_cart_list_key";

	/**
	 * 商品详情缓存
	 */
	public static final String REDIS_GOODS_DETAIL_KEY = "redis_goods_detail_key_";

	/**
	 * 用户信息缓存
	 */
	public static final String REDIS_USER_INFO_KEY = "redis_user_info_key";

	/**
	 * 会员信息缓存
	 */
	public static final String REDIS_MEMBER_KEY = "redis_member_key";

	/**
	 * 角色和权限关系缓存
	 */
	public static final String ROLE_PERMISSION_RELATION_KEY = "role_permission_relation_key";


	/**
	 * 首页数据的key
	 */
	public static final String HOME_PAGE_KEY = "home_page_key";

	/**
	 * @description static不能直接加上获取租户标识的方法，static修饰的变量和方法是随着类的加载而加载 获取租户标识
	 * @param key
	 * @return
	 */
	public static String getTenantCodeAndRedisKey(String key) {
		return TenantCodeUtil.getInstance().getServerTenantCode() + key;
	}
}
